function foo() {
    let i = 0
    return function() {
        if(i) return i
        i = new Date()
        return i
    }
}
var foo1 = foo()
foo1()
console.log(foo1());
console.log(foo1());
setTimeout(() =>{
    console.log(foo1());
},1000)
